﻿namespace Hidistro.UI.SaleSystem.Tags
{
    using Hidistro.UI.Common.Controls;
    using JSShop.Model;
    using Juse.Interface;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Web.UI.WebControls;
    using Hidistro.Entities.Commodities;
    using Hidistro.Membership.Context;
    using wnxd.javascript;

    public class Common_GoodsList_New_Browsed_3q : AscxTemplatedWebControl
    {
        private Repeater PList;
        protected override void AttachChildControls()
        {
            this.PList = (Repeater)this.FindControl("PList");
            try
            {
                aspnet_Members member = null;
                Member m = HiContext.Current.User as Member;
                if (m != null) member = new json(m).TryConvert(typeof(aspnet_Members)) as aspnet_Members;

                IList<int> browedProductList = BrowsedProductQueue.GetBrowedProductList(this.Count);
                this.PList.DataSource = new ProductBrowser().GetVistiedProducts(member, browedProductList);
            }
            catch { this.PList.DataSource = null; }
            this.PList.DataBind();
        }
        protected override void OnInit(EventArgs e)
        {
            if (this.SkinName == null)
            {
                this.SkinName = "/ascx/tags/Common_GoodsList/Skin-Common_GoodsList_New_Browsed_3q.ascx";
            }
            base.OnInit(e);
        }
        public int Count
        {
            get;
            set;
        }
    }
}

